/*
 * @Author: chen1997 1747369444@qq.com
 * @Date: 2024-07-23 08:52:40
 * @LastEditors: chen1997 1747369444@qq.com
 * @LastEditTime: 2024-11-28 14:06:04
 * @FilePath: \ZHGD-Vue2\src\views\ReportDesign\components\mixin\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const report_mixin = {
  methods: {
    percentage(val) { // 百分比
      return Number(val) ? `${val}%` : '';
    },
    // 支表1/申表1 列合并处理函数
    paymentReportSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (rowIndex > 8 && rowIndex != 12) {
          return [1, 2];
        }
      } else if (columnIndex === 1) {
        if (rowIndex > 8 && rowIndex != 12) {
          return [1, 0];
        }
      }
    },
    // 张拉报表合并单元格
    tensioningReportSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0 || columnIndex === 1 || columnIndex === 11 || columnIndex === 12 || columnIndex === 13 || columnIndex === 14 || columnIndex === 15) {
        if (rowIndex % 2) {
          return [1, 0];
        } else {
          return [2, 1];
        }
      }
    },
    // 混凝土压力机报告合并单元格
    strengthreportSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex !== 0) {
        if (columnIndex !== 7) {
          if (rowIndex % 3) {
            return [1, 0];
          } else {
            return [3, 1];
          }
        }
      }
    },

    // 混凝土压力机报表合并单元格
    compressiveStrengthSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex !== 0) {
        if (columnIndex !== 7) {
          if (columnIndex !== 8) {
            if (rowIndex % 3) {
              return [1, 0];
            } else {
              return [3, 1];
            }
          }
        }
      }
    }
  }
}

export default report_mixin;
